app.service("companyService",function ($http) {

    this.findPage = function (pageNum, pageSize,searchEntity) {
        return $http.post("../company/findPage?pageNum=" + pageNum + "&pageSize=" + pageSize,searchEntity)
    };

    this.findOne = function (companyId) {
      return $http.get("../company/findOne?index=" + companyId)
    };

    this.insert = function (entity) {
      return $http.post("../company/insert",entity);
    };

    this.update = function (entity) {
        return $http.post("../company/update",entity);
    };

    this.download = function (searchEntity) {
      return $http.post("../company/download",searchEntity,{"timeout":360000});
    };

    this.createSubAccount = function (entity) {
        return $http.post("../company/createSubAccount",entity);
    };

    this.findBalance = function (companyId) {
        return $http.get("../company/findBalance?index=" + companyId);
    };


    this.modifyAccountStatus = function (modifyAccountStatusParam) {
        return $http.post("../company/modifyAccountStatus",modifyAccountStatusParam);
    };

    this.addContractUrl = function (uploadParam) {
        return $http.post("../company/addContractUrl",uploadParam);
    };

    this.delContractUrl = function (uploadParam) {
        return $http.post("../company/delContractUrl",uploadParam);
    };

    this.addBusinessLicenseUrl = function (uploadParam) {
        return $http.post("../company/addBusinessLicenseUrl",uploadParam);
    };
    this.downloadTaxList = function(companyId){
      return $http.get("../company/downloadTaxList?downloadId=" + companyId)
    };
    this.addIdCard = function (company) {
        return $http.post("../company/addIdCard",company);
    };

    this.createSubAccountForByBank = function (entity) {
        return $http.post("../company/createSubAccountForByBank",entity);
    };

    this.findMyBankBalance = function (companyId) {
        return $http.get("../company/findMyBankBalance?index=" + companyId);
    };

    this.secretKeyDownload = function (companyId) {
        let data = {"companyId":companyId};
        return $http.post("../company/secretKeyDownload",data);
    }
    this.findCompanyTaxCertificateList = function (pageNum, pageSize,searchParams) {
        return $http.post("../company/findCompanyTaxCertificatePage?pageNum=" + pageNum + "&pageSize=" + pageSize,searchParams)
    };

    this.createSubAccountTogetherFundsAlipay = function (companyId, logonId, signingBody) {
        return $http.post("../company/companyAlipaySignByTaxConfig", {companyId: companyId, logonId: logonId, signingBody: signingBody})
    };

    this.queryAccountBookByCompanyId = function (companyId) {
        return $http.get("../company/queryAccountBookByCompanyId?index=" + companyId);
    };

});